home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 November / Freeware November 1998.img / dist / fw_dired.idb / usr / freeware / bin / findstr.z / findstr
Text File  |  1997-09-09  |  302b  |  19 lines

  1.  
  2. exec "perl -Ssw $0 $*"
  3.     if $0;
  4.  
  5. # findstr: print a list of files containing the string $ARGV[0]
  6. #
  7. # $Id: findstr,v 1.1 1994/09/23 22:31:41 lm Exp $
  8.  
  9. $string = shift(@ARGV);
  10. foreach $file (@ARGV) {
  11.     open(FD, $file);
  12.     while (<FD>) {
  13.         next unless /$string/o;
  14.         print "$file\n";
  15.         last;
  16.     }
  17.     close(FD);
  18. }
  19.